#pragma once
#ifndef STORAGE_H
#define STORAGE_H
#include <string>
#include <iostream>
#include <vector>
#include <fstream>
#include "Event.h"
#include <sstream>
#include "dateTime.h"
#include "TimedEvent.h"
#include "DeadlineEvent.h"
#include "FloatingEvent.h"
#include "Logger.h"
#include "assert.h"

 


const std::string PRIORITY_LOW="Low";
const std::string PRIORITY_NORMAL="Normal";
const std::string PRIORITY_HIGH="High";

const std::string TIME_EVENT="TimedEvent";
const std::string DEADLINE_EVENT="DeadlineEvent";
const std::string FLOATING_EVENT="FloatingEvent";
const std::string FILE_NAME="storageFile.txt";
const std::string SLASH="/";
const std::string COMMA=",";
const std::string SYMBOL_LIST=",/:";
const std::string COLON=":";

// ALL logging messages
const std::string DateToString = "Storage translate dateTime to string";
const std:: string EventToString ="Storage translate event to string";
const std:: string SET_IMPORTANCE = "Storage set event importance level";
const std:: string SET_TIME_EVENT_MESSAGE = "Storage translate string information to timedEvent";
const std:: string SET_DEADLINE_EVENT_MESSAGE = "Storage translate string information to deadlinedEvent";
const std:: string SET_FLOATING_EVENT_MESSAGE ="Storage translate string information to floatingEvent";
const std:: string STORAGE_PUSH_EVENT = "Storage push event into a vector of Events";
const std:: string STORAGE_READFILE = "Storage read file";
const std:: string STORAGE_WRITEFILE="Storage write file";

class Storage{

private:
std::string _fileName;
std::vector<Event*> _taskList;


public:

Storage:: Storage();

bool isTimedEvent(Event*); // checking the event type
bool isFloatingEvent(Event*);
bool isDeadlineEvent(Event*);



std::string numberToString(int); 

std::string translateDateTimeToString(DateTime);



std::string translateToString(Event*); // translate an event to a string

void setTaskPriority(std::string, Event*); 

void setTask(Event*);

void translateToTimedTask(std::string, Event*); // translate a string into different type of task

void translateToDeadlineTask(std::string, Event*);

void translateToFloatingTask(std::string, Event*);


std::vector<Event*> readFile();// read string from text file and return a vector of events


void writeFile(std::vector<Event*>); // take in a vector of events and write to the text file

};
#endif

